home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_176.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  7.6 KB  |  292 lines

  1. t    Essential Mac Methods *381*
  2.  
  3. Here is a selection of Mac Methods sufficient to handle most types of graphical operations.  It is divided into the following sections:  
  4.  
  5. Cursor, Pen and Line Drawing, Text, Drawing in Color, Rectangles, Ovals, Round Rectangles, Arcs and Wedges, Bit Transfer, Pictures, Polygons, Points, Resources, Dialogs and Alerts, Graphic Utilities, Miscellaneous Utilities. 
  6.  
  7. Cursor *381*
  8.  
  9. __________________________________________
  10. InitCursor *381*
  11.  
  12. Description:     Sets the current cursor to the standard arrow and sets the cursor level to 0, making the cursor visible.  The cursor level keeps track of the number of times the cursor has been hidden to compensate for nested calls to HideCursor and ShowCursor, explained below.
  13.  
  14.  
  15. __________________________________________
  16. SetCursor *382*
  17.  
  18. Input names:    crsr
  19.  
  20. Input types:    Cursor
  21.  
  22. Description:     Sets the current cursor to the given cursor.
  23.  
  24.  
  25. __________________________________________
  26. SetCCursor *382*
  27.  
  28. Input names:     crsr
  29.  
  30. Input types:     CCrsrHandle
  31.  
  32. Description:     Allows your application to set a multicolor cursor.
  33.  
  34.  
  35. __________________________________________
  36. HideCursor *382*
  37.  
  38. Description:     Removes the cursor from the screen, restoring the bits under it, and decrements the cursor level.
  39.  
  40.  
  41. __________________________________________
  42. ShowCursor*382*
  43.  
  44. Description:     Increments the cursor level, which may have been decremented by HideCursor, and displays the cursor on the screen if the level becomes 0.
  45.  
  46.  
  47. __________________________________________
  48. ObscureCursor *382*
  49.  
  50. Description:     Hides the cursor until the next time the mouse is moved. Unlike HideCursor, it has no effect on cursor level and must not be balanced by a call to ShowCursor.
  51.  
  52.  
  53. __________________________________________
  54. GetCursor *383*
  55.  
  56. Input names:     cursorID 
  57.  
  58. Input types:     integer 
  59.  
  60. Output names:     aCursHandle
  61.  
  62. Output types:     CursHandle 
  63.  
  64. Description:     Returns a handle to the cursor having the given resource ID, reading it from the resource file, if necessary.  If the resource can‚Äôt be read, GetCursor returns NIL.
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        
  74.  You can use any of the following constants to specify cursorID; for more information, see Inside Macintosh.
  75.  
  76. constant value 
  77.  
  78. iBeamCursor    1    
  79.  
  80. crossCursor    2    
  81.  
  82. plusCursor    3    
  83.  
  84. watchCursor    4    
  85.  
  86.  Note that arrow is a Mac global which can be passed directly into SetCursor, with no need to call GetCursor first.
  87.  
  88.  
  89. __________________________________________
  90. GetCCursor *384*
  91.  
  92. Input names:     cursorID 
  93.  
  94. Input types:     integer 
  95.  
  96. Output names:     CursHandle
  97.  
  98. Output types:     CCrsrHandle 
  99.  
  100. Description:     Returns a handle to the color cursor having the given resource ID, reading it from the resource file, if necessary.  If the resource can‚Äôt be read, GetCCursor returns NIL.
  101.  
  102.  
  103. __________________________________________
  104. DisposCCursor *384*
  105.  
  106. Input names:     cCursr 
  107.  
  108. Input types:     CCrsrHandle 
  109.  
  110. Description:     Disposes of all structures allocated by GetCCursor.
  111.  
  112.  
  113. __________________________________________
  114. ShieldCursor *384*
  115.  
  116. Input names:     shieldRect, offsetPoint  
  117.  
  118. Input types:     Rect, Point 
  119.  
  120. Description:     Hides the cursor, if the cursor and the given rectangle intersect.  If they don‚Äôt intersect, the cursor remains visible while the mouse isn‚Äôt moving, but is hidden when the mouse moves.  Like HideCursor, ShieldCursor decrements the cursor level, and should be balanced by a call to ShowCursor.
  121.  
  122.  
  123. __________________________________________
  124. Pen and Line Drawing *384*
  125.  
  126. The pen and line-drawing routines all depend on the coordinate system of the current grafPort.
  127.  
  128.  
  129. __________________________________________
  130. HidePen *384*
  131.  
  132. Description:     Decrements the pen level by 1:   whenever the pen level is negative, the pen doesn‚Äôt draw on the screen. Every call to HidePen should be balanced by a subsequent call to ShowPen.
  133.  
  134.  
  135. __________________________________________
  136. ShowPen *385*
  137.  
  138. Description:     Complement of HidePen; increments the pen level by 1.  If pen level becomes 0, then QuickDraw resumes drawing on the screen.
  139.  
  140.  
  141. __________________________________________
  142. GetPen *385*
  143.  
  144. Input names:     pt 
  145.  
  146. Input types:     Point
  147.  
  148. Output names:     pt 
  149.  
  150. Output types:      Point
  151.  
  152. Description:   Returns the current pen location, in the local coordinates of the current grafPort.
  153.  
  154.  
  155. __________________________________________
  156. GetPenState *385*
  157.  
  158. Input names:     pnState 
  159.  
  160. Input types:   PenState
  161.  
  162. Output names:   pnState
  163.  
  164. Output types:      PenState
  165.  
  166. Description:   Saves the pen location, size, pattern, and mode in aPenState, to be restored later with SetPenState.  This is useful when calling subroutines that operate in the current port but must change the graphics pen.
  167.  
  168.  
  169. __________________________________________
  170. SetPenState *385*
  171.  
  172. Input names:   pnState
  173.  
  174. Input types:   PenState
  175.  
  176. Description:   Sets the pen location, size, pattern and mode in the current grafPort to the values stored in aPenState. This is usually called at the end of a procedure that has altered the pen parameters and wants to restore them to their state at the beginning of the procedure.
  177.  
  178.  
  179. __________________________________________
  180. PenSize *386*
  181.  
  182. Input names:   width, height
  183.  
  184. Input types:   integer, integer
  185.  
  186. Description:   Sets the dimensions of the graphics pen in the current grafPort. 
  187.  
  188.  
  189. __________________________________________
  190. PenMode *386*
  191.  
  192. Input names:   mode
  193.  
  194. Input types:   integer
  195.  
  196. Description:   Sets the transfer mode through which the pen pattern is transferred onto the bit map when lines or shapes are drawn in the current grafPort. The mode may be any one of the eight pattern transfer modes. If the mode is one of the source transfer modes (or negative), no drawing is performed.
  197.  
  198.  You can use the following constants to specify the pattern transfer mode; for more information, see Inside Macintosh.
  199.  
  200. constant value 
  201.  
  202. patCopy    8    
  203.  
  204. patOr    9    
  205.  
  206. patXor    10    
  207.  
  208. patBic    11    
  209.  
  210. notpatCopy    12    
  211.  
  212. notpatOr    13    
  213.  
  214. notpatXor    14    
  215.  
  216. notpatBic    15    
  217.  
  218.  
  219. __________________________________________
  220. PenPat  *387*
  221.  
  222. Input names:   pat
  223.  
  224. Input types:   Pattern
  225.  
  226. Description:   Sets the pattern that‚Äôs used by the pen in the current grafPort.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  You can access any of the following global variables to specify patterns; for more information, see Inside Macintosh.
  234.  
  235. Variable Type Initial Setting 
  236.  
  237. white    Pattern An all-white pattern    
  238.  
  239. black    Pattern    An all-black pattern    
  240.  
  241. gray    Pattern    A 50% gray pattern    
  242.  
  243. ltGray    Pattern    A 25% gray pattern    
  244.  
  245. dkGray    Pattern    A 75% gray pattern    
  246.  
  247.  
  248. __________________________________________
  249. PenNormal  *387*
  250.  
  251. Description:   Resets pen to its initial state in the current grafPort:    transfer mode of patCopy, pen size of 1 pixel by 1 pixel, pattern of solid black.
  252.  
  253.  
  254. __________________________________________
  255. MoveTo  *387*
  256.  
  257. Input names:   h, v
  258.  
  259. Input types:   integer, integer
  260.  
  261. Description:   Moves pen location to location (h,v) in the local coordinates of the current grafPort. No drawing is performed.
  262.  
  263. __________________________________________
  264.  
  265. Move  *387*
  266.  
  267. Input names:   dh, dv
  268.  
  269. Input types:   integer, integer
  270.  
  271. Description:   Moves pen location dh pixels horizontally, dv pixels vertically.  No drawing is performed.
  272.  
  273.  
  274. __________________________________________
  275. LineTo  *388*
  276.  
  277. Input names:   h, v
  278.  
  279. Input types:   integer, integer
  280.  
  281. Description:   Draws a line from the current pen location to the location specified (in local coordinates) by h and v.  The new pen location is (h,v) after the line is drawn.
  282.  
  283.  
  284. __________________________________________
  285. Line  *388*
  286.  
  287. Input names:   dh, dv
  288.  
  289. Input types:   integer, integer
  290.  
  291. Description:   Draws a line dh pixels horizontally, dv pixels vertically from the current pen location and sets the endpoint of the line as the new pen location after the line is drawn.
  292.